<script setup lang="ts">
import { inject, ref, type Ref } from 'vue';

const totalCount=inject<Ref<number>>('totalCount1',ref(0))
inject('updateTotalCount')
</script>
<template>
  <h1>后代组件{{  totalCount }}</h1>
  <button @click="totalCount++">后代修改</button>
</template>